import {defineStore} from "pinia";
import {ref} from "vue";

export const useServiceConfigStore = defineStore('serviceConfig', () => {
    let configCenterDataList = ref([]);
    let configCenterSearchData = ref({});
    let addOrUpdateDialog = ref(false);
    let deleteDialog = ref(false);
    let refreshDialog = ref(false);

    function resetConfigCenterDataList(info) {
        configCenterDataList.value = info
    }

    function resetConfigCenterSearchData(info) {
        configCenterSearchData.value = info;
    }

    function resetAddOrUpdateDialog(flag) {
        addOrUpdateDialog.value = flag;
    }

    function resetDeleteDialog(flag) {
        deleteDialog.value = flag;
    }

    function resetRefreshDialog(flag) {
        refreshDialog.value = flag;
    }

    return { configCenterDataList, resetConfigCenterDataList, configCenterSearchData, resetConfigCenterSearchData, addOrUpdateDialog, resetAddOrUpdateDialog,
        deleteDialog, resetDeleteDialog, refreshDialog, resetRefreshDialog }
})